/// 应用核心配置文件
class AppConfig {
  // 数据库配置
  static const String databaseName = 'green_hydrogen_carbon_footprint.db';
  static const int databaseVersion = 1;
  
  // 用户角色配置
  static const int roleUser = 1;        // 普通用户
  static const int roleAdmin = 2;       // 管理员
  
  // 工艺类型配置
  static const int processElectrolysis = 1;      // 电解水制氢
  static const int processNaturalGas = 2;        // 天然气制氢
  static const int processCoalGasification = 3;  // 煤制氢
  static const int processBiomass = 4;           // 生物质制氢
  
  // 碳足迹详情类型
  static const int detailTypeDirect = 1;         // 直接排放
  static const int detailTypeIndirect = 2;       // 间接排放
  static const int detailTypeEnergy = 3;         // 能源消耗
  
  // 默认管理员账号
  static const String defaultAdminUsername = 'admin';
  static const String defaultAdminPassword = 'admin123';
  static const String defaultAdminPasswordHash = '240be518fabd2724ddb6f04eeb1da5967448d7e831c08c8fa822809f74c720a9';
  
  // 应用信息
  static const String appName = '绿氢制备全流程碳足迹管理平台';
  static const String appVersion = '1.0.0';
  static const String appDescription = 'Green Hydrogen Carbon Footprint Management Platform';
  
  // UI配置
  static const double defaultPadding = 16.0;
  static const double defaultRadius = 8.0;
  static const double defaultElevation = 2.0;
  
  // 颜色配置
  static const int primaryColor = 0xFF1976D2;    // 主色 - 蓝色
  static const int accentColor = 0xFF4CAF50;     // 辅助色 - 绿色
  static const int warningColor = 0xFFFF9800;    // 警告色 - 橙色
  static const int textPrimaryColor = 0xFF212121; // 主要文字色
  static const int textSecondaryColor = 0xFF757575; // 次要文字色
  static const int backgroundColor = 0xFFF5F5F5; // 背景色
  
  // 表单验证规则
  static const int minUsernameLength = 3;
  static const int maxUsernameLength = 50;
  static const int minPasswordLength = 6;
  static const int maxPasswordLength = 20;
  static const int minRealNameLength = 2;
  static const int maxRealNameLength = 50;
  static const int maxEmailLength = 100;
  static const int maxPhoneLength = 20;
  static const int maxDepartmentLength = 100;
  static const int maxPositionLength = 100;
  
  // 碳足迹记录验证规则
  static const int minRecordNameLength = 2;
  static const int maxRecordNameLength = 200;
  static const double minProductionCapacity = 0.01;
  static const double maxProductionCapacity = 1000000.0;
  static const double minEnergyConsumption = 0.0;
  static const double maxEnergyConsumption = 1000000.0;
  static const double minCarbonEmission = 0.0;
  static const double maxCarbonEmission = 1000.0;
  static const double minEquipmentEfficiency = 0.0;
  static const double maxEquipmentEfficiency = 100.0;
  static const int minOperationHours = 0;
  static const int maxOperationHours = 8760;
  static const int maxLocationLength = 200;
  static const int maxProjectPhaseLength = 50;
  
  // 分页配置
  static const int defaultPageSize = 20;
  static const int maxPageSize = 100;
  
  // 日志配置
  static const bool enableDebugLog = true;
  static const bool enableInfoLog = true;
  static const bool enableWarningLog = true;
  static const bool enableErrorLog = true;
  
  // 缓存配置
  static const int maxCacheSize = 100; // MB
  static const Duration cacheExpiration = Duration(hours: 24);
  
  // 网络配置
  static const Duration connectionTimeout = Duration(seconds: 30);
  static const Duration receiveTimeout = Duration(seconds: 30);
  
  // 文件配置
  static const String exportDirectory = 'exports';
  static const String backupDirectory = 'backups';
  static const List<String> supportedImageFormats = ['png', 'jpg', 'jpeg'];
  static const List<String> supportedDocumentFormats = ['pdf', 'xlsx', 'csv'];
  
  // 安全配置
  static const int maxLoginAttempts = 5;
  static const Duration lockoutDuration = Duration(minutes: 30);
  static const bool enablePasswordComplexity = true;
  static const bool enableSessionTimeout = true;
  static const Duration sessionTimeout = Duration(hours: 8);
  
  // 统计配置
  static const int maxChartDataPoints = 100;
  static const String defaultDateFormat = 'yyyy-MM-dd';
  static const String defaultDateTimeFormat = 'yyyy-MM-dd HH:mm:ss';
  
  // 工艺类型映射
  static const Map<int, String> processTypeNames = {
    processElectrolysis: '电解水制氢',
    processNaturalGas: '天然气制氢',
    processCoalGasification: '煤制氢',
    processBiomass: '生物质制氢',
  };
  
  // 详情类型映射
  static const Map<int, String> detailTypeNames = {
    detailTypeDirect: '直接排放',
    detailTypeIndirect: '间接排放',
    detailTypeEnergy: '能源消耗',
  };
  
  // 用户角色映射
  static const Map<int, String> roleNames = {
    roleUser: '普通用户',
    roleAdmin: '管理员',
  };
  
  // 项目阶段选项
  static const List<String> projectPhaseOptions = [
    '规划阶段',
    '设计阶段',
    '建设阶段',
    '试运行',
    '正式运行',
    '维护阶段',
  ];
  
  // 能源来源选项
  static const List<String> energySourceOptions = [
    '太阳能',
    '风能',
    '水能',
    '核能',
    '天然气',
    '煤炭',
    '生物质',
    '其他',
  ];
} 